# Makefile for test programs

export IN_SUBDIR = 1

PWD	= $(shell pwd)
TOP	= $(PWD)/..
SHELL	= /bin/sh
prefix	= /usr/local
exec_prefix=${prefix}
srcdir	= .
sbindir	= ${exec_prefix}/sbin
libdir	= ${exec_prefix}/lib
sysconfdir = ${prefix}/etc
MAKE		= make
CC              = gcc
C++		= g++
OPT	= -O2 -DHAVE_CONFIG_H -DSYSCONFDIR=\"$(sysconfdir)\"
CFLAGS  = -shared -fPIC $(DEBUG) $(INCLUDES)
CFLAGS  = $(DEBUG) $(OPT) $(INCLUDES)
#CFLAGS	+= -Dconnect=sine_connect -Dbind=sine_bind -Dgetsockname=sine_getsockname -Dgetpeername=sine_getpeername -Daccept=sine_accept -Drresvport=sine_rresvport -Dbindresvport=sine_bindresvport -Dgethostbyname=sine_gethostbyname -Dgethostbyname2=sine_gethostbyname2 -Dsendto=sine_sendto -Drecvfrom=sine_recvfrom -Drecvfrom=sine_recvfrom -Dwrite=sine_write -Dwritev=sine_writev -Dlisten=sine_listen -Dsend=sine_send -Dsendmsg=sine_sendmsg -Dread=sine_read -Dreadv=sine_readv -Drecv=sine_recv -Drecvmsg=sine_recvmsg -Dgetaddrinfo=sine_getaddrinfo -Dgetipnodebyname=sine_getipnodebyname

WARN		= 
# -Wall -Wno-unused
DEBUG		= -g -DNDEBUG

default: all

# end of $RCSFile$
LOADLIBES =  -lpthread -lcrypt -lcurl

INCLUDES        = -I. -I$(TOP)/middleware/protocolMgr -I$(TOP)/middleware/connectionMgr -I$(TOP)/middleware/policyMgr -I$(TOP)/middleware/networkMgr -I$(TOP)/middleware/locationMgr

OBJECTS = ../middleware/protocolMgr/sine_socket.o ../middleware/connectionMgr/connectionMgr.o ../middleware/policyMgr/PolicyModel.o ../middleware/policyMgr/PolicyListener.o ../middleware/policyMgr/PolicyController.o ../middleware/networkMgr/nm.o ../middleware/locationMgr/lm.o ../middleware/securityMgr/sm.o
OBJECTS	+= ../middleware/srelay/srelay-0.4.8b5/init.o ../middleware/srelay/srelay-0.4.8b5/readconf.o ../middleware/srelay/srelay-0.4.8b5/util.o ../middleware/srelay/srelay-0.4.8b5/socks.o ../middleware/srelay/srelay-0.4.8b5/relay.o ../middleware/srelay/srelay-0.4.8b5/main.o ../middleware/srelay/srelay-0.4.8b5/auth-pwd.o ../middleware/srelay/srelay-0.4.8b5/get-bind.o

TARGETS = sined

SRCS = ../middleware/protocolMgr/sine_socket.c ../middleware/connectionMgr/connectionMgr.c ../middleware/policyMgr/PolicyModel.cpp ../middleware/policyMgr/PolicyListener.cpp ../middleware/policyMgr/PolicyController.cpp ../middleware/networkMgr/nm.cpp ../middleware/locationMgr/lm.cpp ../middleware/securityMgr/sm.cpp ../middleware/srelay/srelay-0.4.8b5/init.c ../middleware/srelay/srelay-0.4.8b5/readconf.c ../middleware/srelay/srelay-0.4.8b5/util.c ../middleware/srelay/srelay-0.4.8b5/socks.c ../middleware/srelay/srelay-0.4.8b5/relay.c ../middleware/srelay/srelay-0.4.8b5/main.c ../middleware/srelay/srelay-0.4.8b5/auth-pwd.c ../middleware/srelay/srelay-0.4.8b5/get-bind.c

all: $(TARGETS)

$(TARGETS): $(OBJECTS)
	$(C++) $(LDFLAGS) $(OBJECTS) $(LOADLIBES) -o $@

clean:
	rm -f $(OBJECTS) $(TARGETS) *_tcp_kern* *~ core

depend:
	makedepend $(PROF) $(DEBUG) $(LOADLIBES) $(INCLUDES) I.. $(SRCS)

# DO NOT DELETE THIS LINE -- make depend depends on it.

#socks.o: ../middleware/protocolMgr/mptcpMgr.h
#socks.o: ../middleware/policyMgr/policy.h

